package zblibrary.facechat.modules.school;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;

import androidx.fragment.app.Fragment;

import zblibrary.facechat.R;
import zuo.biao.library.base.BaseTabFragment;

public class SchoolInfoFragment extends BaseTabFragment implements OnClickListener {
	private static final String TAG = "MainTabFragment";
	public static final String ARGUMENT_MAIN_TAB = "ARGUMENT_MAIN_TAB";
	private String title;

	public static SchoolInfoFragment createInstance(String title) {
		SchoolInfoFragment fragment = new SchoolInfoFragment();
		Bundle bundle = new Bundle();
		bundle.putString(ARGUMENT_MAIN_TAB, title);

		fragment.setArguments(bundle);
		return fragment;
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		super.onCreateView(inflater, container, savedInstanceState, R.layout.school_info_fragment);
		//		needReload = true;
		argument = getArguments();
		if (argument != null) {
			title = argument.getString(ARGUMENT_MAIN_TAB, title);
		}
		//功能归类分区方法，必须调用<<<<<<<<<<
		initView();
		initData();
		initEvent();
		//功能归类分区方法，必须调用>>>>>>>>>>
		return view;
	}

	@Override
	public void initView() {//必须在onCreate方法内调用
		super.initView();
	}

	@Override
	public void initData() {//必须在onCreate方法内调用
		super.initData();
	}

	@Override
	protected String[] getTabNames() {
		return new String[] {"学校公告", "学院公告"};
	}

	@Override
	protected Fragment getFragment(int position) {
		if (position == 0) {
			return SchoolRecyclerFragment.createInstance(1);
		} else if(position == 1) {
			return SchoolRecyclerFragment.createInstance(2);
		} else {
			return SchoolRecyclerFragment.createInstance(1);
		}
	}

	@Override
	public void initEvent() {//必须在onCreate方法内调用
		super.initEvent();
	}

	@Override
	public void onClick(View v) {
		super.onClick(v);
		switch (v.getId()) {
		default:
			break;
		}
	}

	//生命周期、onActivityResult<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
	private static final int REQUEST_TO_PLACE_PICKER = 10;
	@Override
	public void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
		if (resultCode != RESULT_OK) {
			return;
		}
	}

}